POV-Ray : Newsgroups : povray.newusers : Image Maps : Re: Image Maps Server Time
29 Jul 2024 02:22:49 EDT (-0400)
  Re: Image Maps  
From: Basiclife
Date: 16 Nov 2006 07:20:00
Message: <web.455c5657bef31fb5291c31dd0@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> "Basiclife" <nomail@nomail> wrote in message
> news:web.455b03b9bef31fb5291c31dd0@news.povray.org...
> >
> > Another quick question if I may:
> >
> > In regards to mapping. Assume I had a checker board shape, I'd like the
> > horizontal and vertical lines to act in the same way as lines of lat/long.
> >
> > Secondly, assume my image was 640x480 (for mapping, not the rendered
> > output). How can I rig this so that it is stretched around the equator
> > once
> > - as a world map would have to be and covers 90% of the surface top to
> > bottom?
> >
> > I'm assuming I add another pigment to specify colouring for those
> > non-covered areas but I can work that out by myself.
> >
> > thank you in advance,
> > Simon
> >
> Hi Simon,
>
> I'm not sure that this is what you mean by a checker board shape as it's
> more a grid, but the example below uses a simple straight line texture and
> layers it over and over again. First it rotates it around the y axis by 10
> degrees at a time, then it moves it vertically to cover the sphere, giving
> an effect like the lines of latitude and longitude on a globe.
>
> On your second question, I'd recommend just making an image the right size
> in a graphics editor and pasting the 640x480 image into the middle of it. So
> it the image covers 90% of what you need, you'd create a new image 640x532
> and paste your 640x480 image into it, aligning it in the middle of the new,
> larger image.
>
> By the way, it's probably best to create a new thread on the newsgroup for
> new questions because a lot of contributors may have stopped reading the old
> thread when they saw the original question answered. By creating a new
> thread you'll get a bigger audience and you're more likely to get your new
> questions answered quicker, plus you may well get a broader selection of
> different techniques and suggestions to choose from.
>
> Regards,
> Chris B.
>
>
> #include "math.inc"
> #declare YourObject = sphere {0,1}
>
> #declare LineTexture = texture {
>   pigment {
>     gradient x
>     turbulence 0
>     color_map {
>       [0      rgbt <0,1,0,0>]
>       [0.001  rgbt <0,1,0,0>]
>       [0.001  rgbt <1,1,1,1>]
>       [1      rgbt <1,1,1,1>]
>     }
>   }
>   scale 10
> }
>
> #declare WireframeTexture = texture {LineTexture}
>
> #local I = 0;
> #while (I<180)
>   #declare WireframeTexture =
>     texture {WireframeTexture}
>     texture {LineTexture rotate y*I}
>   #local I = I + 10;
> #end
>
> #local I = -80;
> #while (I<90)
>   #declare WireframeTexture =
>     texture {WireframeTexture}
>     texture {LineTexture rotate z*90 scale 2*y*(1-abs(sind(I)/1.1))
> translate y*sind(I)}
>   #local I = I + 10;
> #end
>
> object {YourObject texture {WireframeTexture}}
>
> camera {location <0,2,-2> look_at 0}
> light_source { <100, 1000, -2000> color rgb 1}

As ebfore, many man thanks for the help and for the advice also.

Jsut to clarify, I meant that if I were to take a rectangular image of a
grid and place it on sphere, I would like the lines to be mapped in such a
way as the would appear to be lines of lat/long.

To try and sort my ramblings out a little more:

the vertical lines would be x distance apart at the equator and 0 distance
apart @ the pole, horizontal lines would be x distance apart continuously,
as in a globe.

Having said that, I can larn a lot from your example anyway as I'm new to
the whole language.

Once again, thank you


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.